<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"></meta>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
    <meta name="viewport" content="width=device-width, initial-scale=1"></meta>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后. -->
    <title>ERP管理系统</title>

    <link href="/include/bootstrapadmin/css/style.default.css" rel="stylesheet"></link>
    <link rel="shortcut icon" href="/include/bootstrapadmin/images/favicon.ico" type="image/png">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
    
    <script src="/include/bootstrapadmin/js/jquery-1.11.1.min.js"></script>

    <script type="text/javascript">
    $(document).ready(function(){
		<?php 
		$request = Zend_Controller_Front::getInstance()->getRequest()->getParams();
		$li = $request['module'].'-'.$request['controller'];
		$li2 = $request['controller'].'-'.$request['action'];
		echo "$('.$li').addClass('active nav-active');";
		echo "$('.$li ul').show();";
		echo "$('.$li2').addClass('active');";
		?>
		$('input[name="checkall"]').click(function() {	
			check = this.checked;		
			$('input[name="isprint[]"]').each(function(){
				this.checked = check;
			});			
			$('input[name="issort[]"]').each(function(){
				this.checked = check;
			});		
			$('input[name="isadd[]"]').each(function(){
				this.checked = check;
			});			
		});
	})
	</script>
	<style type="text/css">
    body{
    	font-family:"Helvetica Neue","Hiragino Sans GB","Segoe UI","Microsoft Yahei","微软雅黑",Tahoma,Arial,STHeiti,sans-serif;
    	font-size: 13px;    	
    }
    .logopanel h4 {
        padding-left: 5px;	
    }
    #loader {
        height: 100%;
        left: 0;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 10000;
    }
    .modal-body {
    	overflow-y: scroll;
    	max-height: 520px;
    }
	</style>
</head>
<body>
<?php 
$user = App_User::getCurrentUser();
if($user){
	$auth = json_decode($user->permission);
?>
<!-- Preloader -->

<div id="preloader">
    <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
</div> 
<div id="loader" style="display: none;">
    <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
</div> 
<section>
    <div class="leftpanel">
        <div class="logopanel">
            <h4>ERP管理系统</h4>
        </div>
    
        <div class="leftpanelinner">
            <!-- This is only visible to small devices -->
            <div class="visible-xs hidden-sm hidden-md hidden-lg">
                <div class="media userlogged">
                    <img alt="" src="/include/bootstrapadmin/images/photos/loggeduser.png" class="media-object">
                    <div class="media-body">
                        <h4><?php echo $user->user_name;?></h4>
                        <span></span>
                    </div>
                </div>
                <h5 class="sidebartitle actitle">账户</h5>
                <ul class="nav nav-pills nav-stacked nav-bracket mb30">
                    <li><a href=""><i class="fa fa-user"></i> <span>主页</span></a></li>
                    <li><a href=""><i class="fa fa-cog"></i> <span>设置</span></a></li>
                    <li><a href=""><i class="fa fa-question-circle"></i> <span>帮助</span></a></li>
                    <li><a href="/user/logout"><i class="fa fa-sign-out"></i> <span>退出</span></a></li>
                </ul>
            </div>

            <h5 class="sidebartitle">ERP Administration</h5>
            <ul class="nav nav-pills nav-stacked nav-bracket">
                <li class="<?php if($li=='admin-index' && $li2=='index-index'){echo 'active';}?>"><a href="/index"><i class="fa fa-home"></i> <span>首页</span></a></li>
                <?php if(in_array('1', $auth)){?>
                <li class="nav-parent admin-stock">
                    <a href=""><i class="fa fa-inbox"></i> <span>库存管理</span></a>
                    <ul class="children">
                        <li class="stock-index stock-update stock-addnum stock-specialmanage stock-createword"><a href="/stock"><i class="fa fa-caret-right"></i>库存列表</a></li>
                        <li class="stock-add"><a href="/stock/add"><i class="fa fa-caret-right"></i>新增库存</a></li>
                        <li class="stock-inventory stock-submitinventory"><a href="/stock/inventory"><i class="fa fa-caret-right"></i>库存盘点</a></li>
                        <li class="stock-updateinventory"><a href="/stock/updateinventory"><i class="fa fa-caret-right"></i>盘点更新</a></li>
                        <li class="stock-exportcurstock"><a href="/stock/exportcurstock"><i class="fa fa-caret-right"></i>当前库存导出</a></li>
                        <li class="stock-exportlowstock"><a href="/stock/exportlowstock"><i class="fa fa-caret-right"></i>低库存导出</a></li>
                        <li class="stock-exportoutstock"><a href="/stock/exportoutstock"><i class="fa fa-caret-right"></i>实际缺货导出</a></li>
                        <li class="stock-deladd"><a href="/stock/deladd"><i class="fa fa-caret-right"></i>库存增删记录</a></li>
                        <li class="stock-unusual stock-updatestockvalue"><a href="/stock/unusual"><i class="fa fa-caret-right"></i>异常库存列表</a></li>
                    </ul>
                </li>
                <?php }?>
                <?php if(in_array('2', $auth)){?>
                <li class="nav-parent admin-log">
                    <a href=""><i class="fa fa-pencil-square"></i> <span>日志管理</span></a>
                    <ul class="children">
                        <li class="log-dailybaohuo"><a href="/log/dailybaohuo"><i class="fa fa-caret-right"></i>每日报货</a></li>
                        <li class="log-baohuo"><a href="/log/baohuo"><i class="fa fa-caret-right"></i>报货日志</a></li>
                        <li class="log-scanimport"><a href="/log/scanimport"><i class="fa fa-caret-right"></i>进库扫描</a></li>
                        <li class="log-scanout"><a href="/log/scanout"><i class="fa fa-caret-right"></i>出库扫描</a></li>
                        <li class="log-makelist log-printlist"><a href="/log/makelist"><i class="fa fa-caret-right"></i>做出货单</a></li>
                        <li class="log-order log-index log-opersort log-scanexport log-omodify log-oper log-pack log-omemo"><a href="/log/order"><i class="fa fa-caret-right"></i>网站订单日志</a></li>
                        <li class="log-modifylog"><a href="/log/modifylog"><i class="fa fa-caret-right"></i>订单修改日志</a></li>
                        <li class="log-sortlog"><a href="/log/sortlog"><i class="fa fa-caret-right"></i>订单分拣日志</a></li>
                        <li class="log-operlog"><a href="/log/operlog"><i class="fa fa-caret-right"></i>操作日志</a></li>
                        <li class="log-packlog"><a href="/log/packlog"><i class="fa fa-caret-right"></i>打包日志</a></li>
                        <li class="log-special"><a href="/log/special"><i class="fa fa-caret-right"></i>特殊库管日志</a></li>
                        <li class="log-numlog"><a href="/log/numlog"><i class="fa fa-caret-right"></i>库存量变化日志</a></li>
                    </ul>
                </li>
                <?php }?>
                <?php if(in_array('3', $auth)){?>
                <li class="nav-parent admin-sale admin-statistics">
                    <a href=""><i class="fa fa-shopping-cart"></i> <span>销售管理</span></a>
                    <ul class="children">
                        <li class="statistics-eday"><a href="/statistics/eday"><i class="fa fa-caret-right"></i>每日销售统计</a></li>
                        <li class="statistics-eweek"><a href="/statistics/eweek"><i class="fa fa-caret-right"></i>每周销售统计</a></li>
                        <li class="statistics-emonth"><a href="/statistics/emonth"><i class="fa fa-caret-right"></i>每月销售统计</a></li>
                        <li class="statistics-equarter"><a href="/statistics/equarter"><i class="fa fa-caret-right"></i>季度销售统计</a></li>
                        <li class="statistics-eyear"><a href="/statistics/eyear"><i class="fa fa-caret-right"></i>全年销售统计</a></li>
                    </ul>
                </li>
                <?php }?>
                <?php if(in_array('4', $auth)){?>
                <li class="nav-parent admin-orm">
                    <a href=""><i class="fa fa-wechat"></i> <span>客户管理</span></a>
                    <ul class="children">
                        <li class=""><a href="#"><i class="fa fa-caret-right"></i>客户列表</a></li>
                        <li class=""><a href="#"><i class="fa fa-caret-right"></i>客户行为分析</a></li>
                    </ul>
                </li>
                <?php }?>
                <?php if(in_array('5', $auth)){?>
                <li class="nav-parent admin-office">
                    <a href=""><i class="fa fa-sitemap"></i> <span>办公管理</span></a>
                    <ul class="children">
                        <li class="office-pubdaily"><a href="/office/pubdaily"><i class="fa fa-caret-right"></i>发布日报</a></li>
                        <li class="office-pubneed"><a href="/office/pubneed"><i class="fa fa-caret-right"></i>发布需求</a></li>
                        <li class="office-mytask"><a href="/office/mytask"><i class="fa fa-caret-right"></i>我的任务</a></li>
                        <li class="office-myneed office-updateneed office-evaluate"><a href="/office/myneed"><i class="fa fa-caret-right"></i>我的需求</a></li>
                        <li class="office-mydaily office-updatedaily"><a href="/office/mydaily"><i class="fa fa-caret-right"></i>我的日报</a></li>
                        <li class="office-needs"><a href="/office/needs"><i class="fa fa-caret-right"></i>需求总览</a></li>
                        <li class="office-tasks"><a href="/office/tasks"><i class="fa fa-caret-right"></i>任务总览</a></li>
                        <?php if($user->is_admin){?>
                        <li class="office-dailys"><a href="/office/dailys"><i class="fa fa-caret-right"></i>日报总览</a></li>
                        <?php } ?>
                        <li class="office-techword"><a href="/office/techword"><i class="fa fa-caret-right"></i>技术文档总览</a></li>
                        <li class="office-operword"><a href="/office/operword"><i class="fa fa-caret-right"></i>运营文档总览</a></li>
                    </ul>
                </li>
                <?php }?>
                <li class="nav-parent admin-user">
                    <a href=""><i class="fa fa-user"></i> <span>我的账户</span></a>
                    <ul class="children">
                        <li class=""><a href="#"><i class="fa fa-caret-right"></i>基本设置</a></li>
                        <li class="user-changepsw"><a href="/user/changepsw"><i class="fa fa-caret-right"></i>修改密码</a></li>
                    </ul>
                </li>
                <?php if(in_array('6', $auth)){?>
                <li class="nav-parent admin-auth">
                    <a href=""><i class="fa fa-users"></i> <span>用户管理</span></a>
                    <ul class="children">
                        <li class="auth-index auth-update"><a href="/auth"><i class="fa fa-caret-right"></i>用户列表</a></li>
                        <li class="auth-add"><a href="/auth/add"><i class="fa fa-caret-right"></i>添加用户</a></li>
                    </ul>
                </li>
                <?php }?>
                <!-- <li class="nav-parent admin-skin">
                    <a href=""><i class="fa fa-laptop"></i> <span>样式布局</span></a>
                    <ul class="children">
                        <li class="skin-layouts"><a href="/index/skin"><i class="fa fa-caret-right"></i>更改皮肤</a></li>
                    </ul>
                </li> -->
            </ul>
        </div>
    </div>

    <div class="mainpanel">
        <div class="headerbar">
            <a class="menutoggle"><i class="fa fa-bars"></i></a>
            <form class="searchform" method="post">
                <input type="text" class="form-control" name="keyword" placeholder="Search here..." />
            </form>

            <div class="header-right">
                <ul class="headermenu">
                    <li>
                        <div class="btn-group">
                            <button class="btn btn-default dropdown-toggle tp-icon" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i>
                                <span class="badge">1</span>
                            </button>
                            <div class="dropdown-menu dropdown-menu-head pull-right">
                                <h5 class="title">1 Newly Registered Users</h5>
                                <ul class="dropdown-list user-list">
                                    <li class="new">
                                        <div class="thumb"><a href=""><img src="/include/bootstrapadmin/images/photos/user1.png" alt="" /></a></div>
                                        <div class="desc">
                                            <h5><a href="">Draniem Daamul (@draniem)</a> <span class="badge badge-success">new</span></h5>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="thumb"><a href=""><img src="/include/bootstrapadmin/images/photos/user3.png" alt="" /></a></div>
                                        <div class="desc">
                                            <h5><a href="">Weno Carasbong (@wenocar)</a></h5>
                                        </div>
                                    </li>
                                    <li class="new"><a href="">See All Users</a></li>
                                </ul>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="btn-group">
                            <button class="btn btn-default dropdown-toggle tp-icon" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-envelope"></i>
                                <span class="badge">1</span>
                            </button>
                            <div class="dropdown-menu dropdown-menu-head pull-right">
                                <h5 class="title">You Have 1 New Message</h5>
                                <ul class="dropdown-list gen-list">
                                    <li class="new">
                                        <a href="">
                                            <span class="thumb"><img src="/include/bootstrapadmin/images/photos/user1.png" alt="" /></span>
                                            <span class="desc">
                                                <span class="name">Draniem Daamul <span class="badge badge-success">new</span></span>
                                                <span class="msg">Lorem ipsum dolor sit amet...</span>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="">
                                            <span class="thumb"><img src="/include/bootstrapadmin/images/photos/user2.png" alt="" /></span>
                                            <span class="desc">
                                                <span class="name">Nusja Nawancali</span>
                                                <span class="msg">Lorem ipsum dolor sit amet...</span>
                                            </span>
                                        </a>
                                    </li>
                                    <li class="new"><a href="">Read All Messages</a></li>
                                </ul>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="btn-group">
                            <button class="btn btn-default dropdown-toggle tp-icon" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-globe"></i>
                                <span class="badge">2</span>
                            </button>
                            <div class="dropdown-menu dropdown-menu-head pull-right">
                                <h5 class="title">You Have 2 New Notifications</h5>
                                <ul class="dropdown-list gen-list">
                                    <li class="new">
                                        <a href="">
                                            <span class="thumb"><img src="/include/bootstrapadmin/images/photos/user4.png" alt="" /></span>
                                            <span class="desc">
                                                <span class="name">Zaham Sindilmaca <span class="badge badge-success">new</span></span>
                                                <span class="msg">is now following you</span>
                                            </span>
                                        </a>
                                    </li>
                                    <li class="new">
                                        <a href="">
                                            <span class="thumb"><img src="/include/bootstrapadmin/images/photos/user5.png" alt="" /></span>
                                            <span class="desc">
                                                <span class="name">Weno Carasbong <span class="badge badge-success">new</span></span>
                                                <span class="msg">is now following you</span>
                                            </span>
                                        </a>
                                    </li>
                                    <li class="new"><a href="">See All Notifications</a></li>
                                </ul>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="btn-group">
                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                <img src="/include/bootstrapadmin/images/photos/loggeduser.png" alt="" /><?php echo $user->user_name;?>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                                <li><a href="#"><i class="glyphicon glyphicon-user"></i>我的主页</a></li>
                                <li><a href="#"><i class="glyphicon glyphicon-cog"></i>用户设置</a></li>
                                <li><a href="#"><i class="glyphicon glyphicon-question-sign"></i>帮助中心</a></li>
                                <li><a href="/user/logout"><i class="glyphicon glyphicon-log-out"></i>退出登录</a></li>
                            </ul>
                        </div>
                    </li>
                    <li>
                        <button id="chatview" class="btn btn-default tp-icon chat-icon">
                            <i class="glyphicon glyphicon-comment"></i>
                        </button>
                    </li>
                </ul>
            </div>
        </div>
        <?php echo $this->layout()->content;?>   
    </div>

    <div class="rightpanel">
        <!-- Nav tabs -->
        <ul class="nav nav-tabs nav-justified">
            <li class="active"><a href="#rp-alluser" data-toggle="tab"><i class="fa fa-users"></i></a></li>
            <li><a href="#rp-favorites" data-toggle="tab"><i class="fa fa-heart"></i></a></li>
            <li><a href="#rp-history" data-toggle="tab"><i class="fa fa-clock-o"></i></a></li>
            <li><a href="#rp-settings" data-toggle="tab"><i class="fa fa-gear"></i></a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <div class="tab-pane active" id="rp-alluser">
                <h5 class="sidebartitle">Online Users</h5>
                <ul class="chatuserlist">
                    <li class="online">
                        <div class="media">
                            <a href="#" class="pull-left media-thumb">
                                <img alt="" src="/include/bootstrapadmin/images/photos/userprofile.png" class="media-object">
                            </a>
                            <div class="media-body">
                                <strong>Eileen Sideways</strong>
                                <small>Los Angeles, CA</small>
                            </div>
                        </div><!-- media -->
                    </li>
                    <li class="online">
                        <div class="media">
                            <a href="#" class="pull-left media-thumb">
                                <img alt="" src="/include/bootstrapadmin/images/photos/user1.png" class="media-object">
                            </a>
                            <div class="media-body">
                                <span class="pull-right badge badge-danger">2</span>
                                <strong>Zaham Sindilmaca</strong>
                                <small>San Francisco, CA</small>
                            </div>
                        </div><!-- media -->
                    </li>
                </ul>
                <div class="mb30"></div>
                <h5 class="sidebartitle">Offline Users</h5>
                <ul class="chatuserlist">
                    <li>
                        <div class="media">
                            <a href="#" class="pull-left media-thumb">
                                <img alt="" src="/include/bootstrapadmin/images/photos/user5.png" class="media-object">
                            </a>
                            <div class="media-body">
                                <strong>Eileen Sideways</strong>
                                <small>Los Angeles, CA</small>
                            </div>
                        </div><!-- media -->
                    </li>
                </ul>
            </div>
            <div class="tab-pane" id="rp-favorites">
                <h5 class="sidebartitle">Favorites</h5>
                <ul class="chatuserlist">
                    <li class="online">
                        <div class="media">
                            <a href="#" class="pull-left media-thumb">
                                <img alt="" src="/include/bootstrapadmin/images/photos/user2.png" class="media-object">
                            </a>
                            <div class="media-body">
                                <strong>Eileen Sideways</strong>
                                <small>Los Angeles, CA</small>
                            </div>
                        </div><!-- media -->
                    </li>
                </ul>
            </div>
            <div class="tab-pane" id="rp-history">
                <h5 class="sidebartitle">History</h5>
                <ul class="chatuserlist">
                    <li class="online">
                        <div class="media">
                            <a href="#" class="pull-left media-thumb">
                                <img alt="" src="/include/bootstrapadmin/images/photos/user4.png" class="media-object">
                            </a>
                            <div class="media-body">
                                <strong>Eileen Sideways</strong>
                                <small>Hi hello, ctc?... would you mind if I go to your...</small>
                            </div>
                        </div><!-- media -->
                    </li>
                </ul>
            </div>
            <div class="tab-pane pane-settings" id="rp-settings">
                <h5 class="sidebartitle mb20">Settings</h5>
                <div class="form-group">
                    <label class="col-xs-8 control-label">Show Offline Users</label>
                    <div class="col-xs-4 control-label">
                        <div class="toggle toggle-success"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-8 control-label">Enable History</label>
                    <div class="col-xs-4 control-label">
                        <div class="toggle toggle-success"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-8 control-label">Show Full Name</label>
                    <div class="col-xs-4 control-label">
                        <div class="toggle-chat1 toggle-success"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-8 control-label">Show Location</label>
                    <div class="col-xs-4 control-label">
                        <div class="toggle toggle-success"></div>
                    </div>
                </div>
            </div><!-- tab-pane -->
        </div><!-- tab-content -->
    </div><!-- rightpanel -->
</section>
<?php 
}else{
	echo $this->layout()->content;//登录
}
?>

<script src="/include/bootstrapadmin/js/jquery-migrate-1.2.1.min.js"></script>
<script src="/include/bootstrapadmin/js/bootstrap.min.js"></script>
<script src="/include/bootstrapadmin/js/modernizr.min.js"></script><!-- 它能够很快的建立起适应任何设备的html页面 -->
<script src="/include/bootstrapadmin/js/jquery.sparkline.min.js"></script>
<script src="/include/bootstrapadmin/js/jquery.cookies.js"></script>
<script src="/include/bootstrapadmin/js/toggles.min.js"></script>
<script src="/include/bootstrapadmin/js/retina.min.js"></script>
<script src="/include/bootstrapadmin/js/custom.js"></script>   
</body>
</html>